package com.java.date;
//7、今天10.8号，输出 10天前的日期，40天前的日期Date,Calendar 了解Calendar
import java.util.Calendar;
import java.util.Date;

public class Demo {

	public static void main(String[] args) {
		Calendar cal = Calendar.getInstance();
		System.out.println(cal.get(Calendar.YEAR));
		System.out.println(cal.get(Calendar.MONTH));
		System.out.println(cal.get(Calendar.DAY_OF_WEEK));
		System.out.println(cal.get(Calendar.DAY_OF_MONTH));
		
		//b不可以new对象，该类是抽象类
		Calendar call = Calendar.getInstance();
		//获取今天的日期
		Date date = new Date();
		//获取今天的具体时间
		Date dt = call.getTime();
		//往前推一天
		call.add(call.DATE, -1);
		call.add(Calendar.DATE,-2);
		
		call.add(Calendar.YEAR, 1);
		dt = call.getTime();
		System.out.println(dt.toLocaleString());
		
		for(int i=1990 ;i<cal.get(Calendar.YEAR);i++){
		
		}
		
	}
}
